<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Hello React!</title>
    <script src="./react.min.js"></script>
    <script src="./react-dom.min.js"></script>
    <script src="https://cdn.bootcss.com/babel-standalone/6.22.1/babel.min.js"></script>
  </head>
  <body>
     <div id="example"></div>
    <script type="text/babel">
    var WebSite = React.createClass({
      getInitialState: function() {
        return {
          name: "菜鸟教程",
          site: "http://www.runoob.com"
        };
      },
     
      render: function() {
        return (
          <div>
            <Name name={this.state.name} />
            <Link site={this.state.site} />
          </div>
        );
      }
    });

    var Name = React.createClass({
      render: function() {
        return (
          <h1>{this.props.name}</h1>
        );
      }
    });

    var Link = React.createClass({
      render: function() {
        return (
          <a href={this.props.site}>
            {this.props.site}
          </a>
        );
      }
    });

    ReactDOM.render(
      <WebSite />,
      document.getElementById('example')
    );
    </script>
  </body>
</html>